﻿using System;
using System.Collections.Generic;
using System.Text;

using System.IO;
namespace Tickz.Tools
{
    public class LogControl
    {
        public static void WriteLog(string str)
        {            
            //根路径
            string logPath = new BSConfigParams().ApplicationRootRealPath+"/log/";

            if (!Directory.Exists(logPath))
            {
                Directory.CreateDirectory(logPath);
            }
            if (!File.Exists(logPath + "webLog.txt"))
            {
                File.Create(logPath + "webLog.txt");
            }

            StreamWriter swriter = new StreamWriter(logPath+"webLog.txt",true);
            swriter.WriteLine("=================================================================================");
            swriter.WriteLine(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss >>")+str);
            swriter.Close();
        }
    }
}
